package com.prj.ufdm.core.enums;

/**
 * 核心模块返回码（编码规则：00 + 2位功能编号  + 3位错误编号）
 * @author 胡义振
 * @date 2018-03-19
 */
public enum CoreRetCodeEnum {
	
	RET_CODE_0000000("0000000","执行成功"),
	RET_CODE_9999995("9999995","当前系统环境不匹配，启动失败！"),
	RET_CODE_9999996("9999996","配置的内部服务地址错误，请与管理员核对！"),
	RET_CODE_9999997("9999997","第三方接口异常"),
	RET_CODE_9999998("9999998","响应超时异常"),
	RET_CODE_9999999("9999999","系统异常");
	
	private String code;
	private String message;
	
	CoreRetCodeEnum(String code,String message){
		this.code = code;
		this.message = message;
	}

	public static String getRetMessage(String retCode){
		String rtnRetCode = "";
		for (CoreRetCodeEnum coreRetCodeEnum : CoreRetCodeEnum.values()) {
			if(coreRetCodeEnum.code.equals(retCode)){
				rtnRetCode = coreRetCodeEnum.message;
			}
	    }
		return rtnRetCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}
